#include "Scene05.hpp"

Scene05::Scene05() {
    this->setMessage("Oh, one more thing: use the mouse wheel to 'change your point of view'");

    b2Vec2 vertices[8];
    vertices[0].Set(-8.4f, -4.0f);
    vertices[1].Set(8.4f, -4.0f);
    vertices[2].Set(8.4f, -2.0f);
    vertices[3].Set(6.4f, -2.0f);
    vertices[4].Set(6.4f, 4.0f);
    vertices[5].Set(-6.4f, 4.0f);
    vertices[6].Set(-6.4f, -2.0f);
    vertices[7].Set(-8.4f, -2.0f);

    this->createRoom(5, vertices, 8);

    b2Vec2 platformVertices[2];
    platformVertices[0].Set(0.0f, 1.0f);
    platformVertices[1].Set(0.0f, -4.0f);

    this->createPlatform(platformVertices, 2);

    this->start = this->createDoor(-6.4f, -3.0f, -1.0f);
    this->createExit(7.4f, -3.0f);
    this->hero = this->createHero(-8.4f + HeroElement::WIDTH / 2.0f, -4.0f + HeroElement::HEIGHT / 2.0f);

    // Left light.
    SpotlightElement* leftLight = this->createSpotlight(-1.7f, 3.5f, -11.0f * b2_pi / 32.0f, b2_pi / 6.0f, 10.0f, LightElement::attractiveLight);
    this->createSwitch(-3.55f, -4.0f, 0.0f, leftLight);

    // Box to open the exit.
    this->exit = this->createDoor(6.4f, -3.0f, 1.0f);
    this->createSwitch(-0.85f, -4.0f, 0.0f, this->exit);
    this->createBox(2.55f, -3.5f);

    // Right light.
    SpotlightElement* rightLight = this->createSpotlight(1.7f, 3.5f, -21.0f * b2_pi / 32.0f, b2_pi / 6.0f, 10.0f, LightElement::attractiveLight);
    this->createSwitch(0.85f, -4.0f, 0.0f, rightLight);
}
